<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>

    function ajax(type,url,s,f) {
        var xmlHttpR;
    
        if (window.XMLHttpRequest) {
            xmlHttpR = new XMLHttpRequest(); // 创建XMLHttpRequest对象
        } else {
            // ie5 ie6
            xmlHttpR = new ActiveXObject() // 创建XMLHttpRequest对象
        }
        xmlHttpR.open('GET', 'https://yc211.cn:88/api/v1/banner/1');
        xmlHttpR.send();
        //监听请求的变化 
        xmlHttpR.onreadystatechange = function () {
            if (xmlHttpR.readyStata === 4 && xmlHttpR.status === 200) {
                s(xmlHttpR.responseText)
                console.log(xmlHttpR.responseText)
            }
        }
    }



    ajax('post', 'xxx', function s(res) {
        console.log(res)
    })
</script>

</html>